#coding=utf-8

class Const(object):
    class ConstError(TypeError): pass
    class ConstCaseError(ConstError): pass

    def __getattr__(self, key):
        if self.__dict__.has_key(key):
            return self.key
        return None
        
    def __setattr__(self, name, value):
		if self.__dict__.has_key(name):
			raise self.ConstError, "Can not change const %s" % name
		if not name.isupper():
			raise self.ConstCaseError, "const name %s is not all upper"  % name
		self.__dict__[name] = value
		


import sys
sys.modules[__name__] = Const()
